<?php
$host="localhost";
$bdname="test";
$pass="";
$user="root";
//include 'conn.inc.php';
//$mysqli=new mysqli(HOST,USER,PWD,DBNAME);
//$mysqli=new PDO('mysql:host=localhost;dbname=test', $user, $pass);
//var_dump($mysqli);
// if($mysqli->connect_errno){
//     die('数据库链接出错'.$mysqli->connect_error);
// }
try
{
    $mysqli = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
    $mysqli->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e)
{
    echo 'Connection failed: ' . $e->getMessage();
}
?>